using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_AccessControlMap : EntityTypeConfiguration<t_AccessControl>
    {
        public t_AccessControlMap()
        {
            // Primary Key
            this.HasKey(t => new { t.FObjectType, t.FObjectID, t.FUserID, t.FAccessType });

            // Properties
            this.Property(t => t.FObjectType)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FObjectID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FUserID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FAccessType)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            // Table & Column Mappings
            this.ToTable("t_AccessControl");
            this.Property(t => t.FObjectType).HasColumnName("FObjectType");
            this.Property(t => t.FObjectID).HasColumnName("FObjectID");
            this.Property(t => t.FUserID).HasColumnName("FUserID");
            this.Property(t => t.FAccessType).HasColumnName("FAccessType");
            this.Property(t => t.FAccessMask).HasColumnName("FAccessMask");
        }
    }
}
